import { createSlice } from '@reduxjs/toolkit'

const initialState = {
 name:'北京'
}

export const homeSlice = createSlice({
  name: 'home',
  initialState,
  reducers: { 
    getCity: (state, action) => {
      state.name=action.payload
    },
  },
})

// Action creators are generated for each case reducer function
export const {  getCity } = homeSlice.actions

export default homeSlice.reducer